{% extends 'base.html' %}
	{% block title %}
        天天生鲜-首页
    {% endblock title %}

{% block body %}


	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="{% url 'goods:index' %}">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		<ul class="subnav fl">
            {% for category in categories %}
                <li><a href="{% url 'goods:list' category.id 1 %}" class="{{ category.logo }}">{{ category.name }}</a></li>
            {% endfor %}
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
                {% for banner in banners %}
                    <li><img src="{{ banner.image.url }}" alt="幻灯片"></li>
                {% endfor %}
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
            {% for promotion in promotions %}
		    	<a href="{{ promotion.url }}"><img src="{{ promotion.image.url }}"></a>

            {% endfor %}
		</div>
	</div>
    {% for category in categories %}

        <div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model0{{ forloop.counter }}">{{ category.name }}</h3>
			<div class="subtitle fl">
				<span>|</span>
                {% for title_banner in category.title_banners %}
                    <a href="{% url 'goods:detail' title_banner.sku.id %}">{{ title_banner.sku.name }}</a>
                {% endfor %}
			</div>
			<a href="#" class="goods_more fr" id="fruit_more">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ category.image.url }}"></div>
			<ul class="goods_list fl">
                {% for image_banner in category.image_banners %}
                    <li>
                        <h4><a href="{% url 'goods:detail' image_banner.sku.id %}">{{ image_banner.sku.name }}</a></h4>
                        <a href="{% url 'goods:detail' image_banner.sku.id %}"><img src="{{ image_banner.sku.default_image.url }}"></a>
                        <div class="prize">¥ {{ image_banner.sku.price }}</div>
				    </li>
                {% endfor %}

			</ul>
		</div>
	</div>

    {% endfor %}

{% endblock body %}
